package com.praveen.twu.item;

/**
 * Created by praveen on 20/6/14.
 */
public class Movie {
    private String name;
    private String director;
    private int rating;
    private int year;

    public Movie(String name, String director, int year, int rating) {
        if (rating < 1 || rating > 10 || year < 1850 || year > 2014)
            return;
        this.rating = rating;
        this.name = name;
        this.director = director;
        this.year = year;
    }

    public String toString() {
        return "\nName: " + getName() + "\nYear of Release: " + getYear() + "\nDirector: " + getDirector() + "\nRating: " + getRating() + "\n";
    }

    public String getName() {
        return name;
    }

    public String getDirector() {
        return director;
    }

    public int getRating() {
        return rating;
    }

    public int getYear() {
        return year;
    }
}